//
//  Race.h
//  Racing
//
//  Created by vy phan on 4/17/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Track.h"
#import "Vehicle.h"

@interface Race : NSObject {
	@private
	// track dang dua
	Track *track;
	// xe dang dua
	NSMutableArray *vehicles;
	NSMutableArray *currentSections;
	NSMutableArray *nextSections;
	NSMutableArray *ranks;
	NSMutableArray *trackCounts;
	int numLaps;
	Vehicle *localVehicle;
	// den nhap nhay luc bat dau
	long lightsStarted;
	bool lightsDone;
	int currentLight;
}
-(id) initWithTrack:(Track*)track_ Vehicles:(NSMutableArray*)vehicles_;
-(id) initWithLocalVehicle:(Vehicle*)local Track:(Track*)track_ Vehicles:(NSMutableArray*)vehicles_;
-(void) reset;
-(void) integrate:(float)dt;
-(BOOL) checkCollisions;
-(int) getRank:(Vehicle*)vehicle_ ;
-(NSMutableArray*) getRanks;
-(int) getTrackCount:(Vehicle*)vehicle_;
-(int) getNumLaps;
-(NSMutableArray*) getTrackCounts;
-(Track*) getTrack;
-(NSMutableArray*) getVehicles;
@end
